home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mmdf / mmdf-IIb.43 / src / pobox / po_wtmail.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-02-01  |  3.1 KB  |  115 lines

  1. #include "util.h"
  2. #include "mmdf.h"
  3.  
  4. /*
  5.  *     MULTI-CHANNEL MEMO DISTRIBUTION FACILITY  (MMDF)
  6.  *     
  7.  *
  8.  *     Copyright (C) 1979,1980,1981  University of Delaware
  9.  *     
  10.  *     Department of Electrical Engineering
  11.  *     University of Delaware
  12.  *     Newark, Delaware  19711
  13.  *
  14.  *     Phone:  (302) 738-1163
  15.  *     
  16.  *     
  17.  *     This program module was developed as part of the University
  18.  *     of Delaware's Multi-Channel Memo Distribution Facility (MMDF).
  19.  *     
  20.  *     Acquisition, use, and distribution of this module and its listings
  21.  *     are subject restricted to the terms of a license agreement.
  22.  *     Documents describing systems using this module must cite its source.
  23.  *
  24.  *     The above statements must be retained with all copies of this
  25.  *     program and may not be removed without the consent of the
  26.  *     University of Delaware.
  27.  *     
  28.  *
  29.  *     version  -1    David H. Crocker    March   1979
  30.  *     version   0    David H. Crocker    April   1980
  31.  *     version  v7    David H. Crocker    May     1981
  32.  *     version   1    David H. Crocker    October 1981
  33.  *
  34.  */
  35. extern struct ll_struct   *logptr;
  36.  
  37. /* *******  (po_)  POBOX (PICKUP) MAIL-WRITING I/O SUB-MODULE  ******** */
  38.  
  39. /* ARGSUSED */
  40.  
  41. po_winit (vianet, info, retadr)  /* pass msg initialization info       */
  42. char    vianet[];          /* what channel coming in from        */
  43. char    info[],              /* general info                       */
  44.         retadr[];          /* return address for error msgs      */
  45. {
  46.     short     retval;
  47.     char linebuf[LINESIZE];
  48.  
  49. /* DBG:  make sure info has right form */
  50.  
  51. #ifdef DEBUG
  52.     ll_log (logptr, LLOGBTR, "po_winit");
  53. #endif
  54.  
  55.     sprintf (linebuf, "%s;%s", info, retadr);
  56.                   /* slave:  <info> ';'<retadr>    */
  57.     retval = po_wrec (linebuf, strlen (linebuf));
  58.  
  59.     return (retval);
  60. }
  61. /* */
  62.  
  63. /*ARGSUSED*/
  64. po_wadr (host, adr)              /* send one address spec to local     */
  65. char    *host,              /* "next" location part of address    */
  66.         *adr;              /* rest of address                    */
  67. {
  68.     short     retval;
  69.     char adrbuf[LINESIZE];
  70.  
  71. #ifdef DEBUG
  72.     ll_log (logptr, LLOGBTR, "po_wadr()");
  73. #endif
  74.  
  75.     strcpy (adrbuf, adr);
  76.                   /* tell the user, if watching         */
  77.     retval = po_wrec (adrbuf, strlen (adrbuf));
  78.  
  79.     return (retval);
  80. }
  81.  
  82. po_waend ()                      /* end of address lsit                */
  83. {
  84.     short     retval;
  85. #ifdef DEBUG
  86.     ll_log (logptr, LLOGBTR, "po_waend");
  87. #endif
  88.  
  89.     if (rp_isbad (retval = (po_wrec ((char *) 0, 0))))
  90.     return (retval);
  91.     return (RP_DONE);
  92. }
  93. /* */
  94.  
  95. po_wtxt (buffer, len)            /* send next part of msg text         */
  96. char    buffer[];          /* the text                           */
  97. short     len;                      /* length of text                     */
  98. {
  99. #ifdef DEBUG
  100.     ll_log (logptr, LLOGBTR, "po_wtxt()");
  101. #endif
  102.  
  103.     return (po_wstm (buffer, len));
  104. }
  105.  
  106. po_wtend ()                      /* end of message text                */
  107. {
  108. #ifdef DEBUG
  109.     ll_log (logptr, LLOGBTR, "po_wtend");
  110. #endif
  111.  
  112.     po_wstm ((char *) 0, 0);      /* flush the output buffer            */
  113.     return (po_wrec ((char *) 0, 0));  /* signal end of stream               */
  114. }
  115.